<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>为 PHP 的值获取 xmlrpc 的类型</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xmlrpc-encode.html">xmlrpc_encode</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xmlrpc-is-fault.html">xmlrpc_is_fault</a></div>
 <div class="up"><a href="ref.xmlrpc.html">XML-RPC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.xmlrpc-get-type" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">xmlrpc_get_type</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5)</p><p class="refpurpose"><span class="refname">xmlrpc_get_type</span> &mdash; <span class="dc-title">为 PHP 的值获取 xmlrpc 的类型</span></p>

   </div>
 <div class="refsect1 description" id="refsect1-function.xmlrpc-get-type-description">
  <h3 class="title">说明</h3>
     <div class="methodsynopsis dc-description">
      <span class="type">string</span> <span class="methodname"><strong>xmlrpc_get_type</strong></span>
       ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
      )</div>

     <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象，包括名称及其相关文档都可能在未来的
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>
    <p class="para">
该函数对于 base64 与日期时间字符串特别有用。
    </p>
   </div>


 <div class="refsect1 parameters" id="refsect1-function.xmlrpc-get-type-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">value</code></em></dt>

     <dd>

      <p class="para">
       PHP value
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.xmlrpc-get-type-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the XML-RPC type.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.xmlrpc-get-type-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5231">
    <p><strong>Example #1 XML-RPC type example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;base64<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;boolean<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;int<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;double<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #DD0000">""</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;string<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(array())&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;array<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">stdClass</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;array<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">xmlrpc_get_type</span><span style="color: #007700">(</span><span style="color: #0000BB">STDIN</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;int<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.xmlrpc-get-type-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.xmlrpc-set-type.html" class="function" rel="rdfs-seeAlso">xmlrpc_set_type()</a> - 为一个 PHP 字符串值设置 xmlrpc 的类型、base64 或日期时间</span></li>
   </ul>
  </p>
 </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xmlrpc-encode.html">xmlrpc_encode</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xmlrpc-is-fault.html">xmlrpc_is_fault</a></div>
 <div class="up"><a href="ref.xmlrpc.html">XML-RPC 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
